feat(vnext): prepare catalog epoch transitions#194
Merged
Conversation
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Light2Dark
marked this pull request as ready for review
July 25, 2026 07:23
There was a problem hiding this comment.
Pull request overview
Adds a synchronous, package-owned “epoch transition” hook to the vnext catalog epoch coordinator so work can be retired deterministically between epoch installation and session revision listener dispatch, while tightening cleanup/dispatch contracts to exact undefined and hardening against hostile thenables.
Changes:
- Introduces
SqlCatalogEpochTransitionTargetand wires prepare/dispatch into the epoch coordinator with deterministic ordering and fail-closed quarantine on invalid/throwing behavior. - Tightens
SqlCatalogSubscriptionCleanupto a synchronous exact-undefinedreturn contract, with best-effort draining for accidental Promise/thenable returns after disposal. - Expands type fixtures, lifecycle/adversarial tests, adds a transition-hook storm benchmark, and updates ADR 0005 to document the new lifecycle/contract.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/vnext-types/marimo-relation-completion.test-d.ts | Extends d.ts fixtures to enforce exact-undefined cleanup and exact-undefined transition dispatch typing. |
| src/vnext/relation-completion-types.ts | Tightens SqlCatalogSubscriptionCleanup to () => undefined for exact synchronous cleanup typing. |
| src/vnext/relation-catalog-epoch-coordinator.ts | Implements transition prepare/dispatch hook, strict cleanup/dispatch return handling, and detached settlement draining. |
| src/vnext/tests/relation-catalog-epoch-coordinator.test.ts | Adds ordering, reentrancy, and adversarial tests for transition hook and exact-return cleanup/dispatch behavior. |
| src/vnext/tests/relation-catalog-epoch-coordinator.bench.ts | Adds benchmark coverage for configured (null-dispatch) transition hook under callback storms. |
| docs/adr/0005-parser-independent-relation-completion.md | Documents the new transition hook lifecycle and the tightened exact-undefined cleanup contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Light2Dark
force-pushed
the
codex/vnext-catalog-transition-hook
branch
from
July 25, 2026 07:34
23cc3f8 to
9d7c9c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #169. Follows #193.
undefinedcontract, with fail-closed quarantine for invalid returns.Summary by cubic
Adds a package-private, synchronous epoch-transition hook that runs after epoch install to retire catalog work before session listeners. Enforces exact-return contracts and fail-closed handling to harden reentrancy, cleanup, and poisoned-thenable edge cases; supports #169.
New Features
SqlCatalogEpochTransitionTargetthat may return a dispatch closure ornull; dispatch must return exactlyundefined(sync only).reason: "invalid-transition-target"); any thrown preparation, thrown dispatch, or non-undefinedreturn disposes fail-closed and discards response decisions.null-dispatch paths allocate nothing. Updated ADR 0005, added a configured-hook storm benchmark, and expanded adversarial tests.Migration
SqlCatalogSubscriptionCleanupto be synchronous and returnundefinedonly (no Promises or other return values).Written for commit 9d7c9c3. Summary will update on new commits.